package com.whq.security.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {

    @RequestMapping("/login")
    public boolean login(@RequestParam(name = "username") String userName, @RequestParam(name = "password") String password) {
        if ("admin".equals(userName) && "admin".equals(password)){
            return true;
        }
        return false;
    }

    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }
}
